import 'package:demo_xm/generated/json/base/json_convert_content.dart';
import 'package:demo_xm/model/test_bean_entity.dart';

TestBeanEntity $TestBeanEntityFromJson(Map<String, dynamic> json) {
	final TestBeanEntity testBeanEntity = TestBeanEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		testBeanEntity.code = code;
	}
	final TestBeanData? data = jsonConvert.convert<TestBeanData>(json['data']);
	if (data != null) {
		testBeanEntity.data = data;
	}
	return testBeanEntity;
}

Map<String, dynamic> $TestBeanEntityToJson(TestBeanEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['data'] = entity.data.toJson();
	return data;
}

TestBeanData $TestBeanDataFromJson(Map<String, dynamic> json) {
	final TestBeanData testBeanData = TestBeanData();
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		testBeanData.name = name;
	}
	final List<TestBeanDataTag>? tag = jsonConvert.convertListNotNull<TestBeanDataTag>(json['tag']);
	if (tag != null) {
		testBeanData.tag = tag;
	}
	return testBeanData;
}

Map<String, dynamic> $TestBeanDataToJson(TestBeanData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['name'] = entity.name;
	data['tag'] =  entity.tag.map((v) => v.toJson()).toList();
	return data;
}

TestBeanDataTag $TestBeanDataTagFromJson(Map<String, dynamic> json) {
	final TestBeanDataTag testBeanDataTag = TestBeanDataTag();
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		testBeanDataTag.name = name;
	}
	final int? type = jsonConvert.convert<int>(json['type']);
	if (type != null) {
		testBeanDataTag.type = type;
	}
	return testBeanDataTag;
}

Map<String, dynamic> $TestBeanDataTagToJson(TestBeanDataTag entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['name'] = entity.name;
	data['type'] = entity.type;
	return data;
}